/**
 * 阿里图库图标配置文件
 * 基于基层治理平台图标库
 * 在线链接: //at.alicdn.com/t/c/font_5003694_ptktn0w5qh.js
 */

// 设备类图标配置
export const EQUIPMENT_ICONS = {
  // 消防设备
  XIAOFANG: {
    name: 'equipment-xiaofang',
    label: '消防设备',
    category: 'equipment',
    keywords: ['消防', '灭火', '安全', 'equipment', 'firefighting']
  },
  // 水泵设备
  SHUIBENG: {
    name: 'equipment-shuibeng',
    label: '水泵',
    category: 'equipment',
    keywords: ['水泵', '供水', '设备', 'equipment', 'water pump']
  },
  // 门禁系统
  MENJIN: {
    name: 'equipment-menjin',
    label: '门禁',
    category: 'equipment',
    keywords: ['门禁', '门锁', '安全', 'equipment', 'access control']
  },
  // 监控设备
  JIANKONG: {
    name: 'equipment-jiankong',
    label: '监控',
    category: 'equipment',
    keywords: ['监控', '摄像头', '安全', 'equipment', 'monitoring']
  }
};

// 人员类图标配置
export const PERSON_ICONS = {
  // 党员
  DANGYUAN: {
    name: 'person-dangyuan',
    label: '党员',
    category: 'person',
    keywords: ['党员', '政治', '身份', 'person', 'party member']
  },
  // 医生
  YISHENG: {
    name: 'person-yisheng',
    label: '医生',
    category: 'person',
    keywords: ['医生', '医疗', '医护', 'person', 'doctor']
  },
  // 消防员
  XIAOFANGYUAN: {
    name: 'person-xiaofangyuan',
    label: '消防员',
    category: 'person',
    keywords: ['消防员', '消防', '救援', 'person', 'firefighter']
  }
};

// 所有图标集合
export const ALL_ICONS = {
  ...EQUIPMENT_ICONS,
  ...PERSON_ICONS
};

// 按分类获取图标
export const getIconsByCategory = (category) => {
  return Object.values(ALL_ICONS).filter(icon => icon.category === category);
};

// 搜索图标
export const searchIcons = (keyword) => {
  const searchTerm = keyword.toLowerCase();
  return Object.values(ALL_ICONS).filter(icon => 
    icon.keywords.some(key => key.toLowerCase().includes(searchTerm)) ||
    icon.label.toLowerCase().includes(searchTerm) ||
    icon.name.toLowerCase().includes(searchTerm)
  );
};

// 获取图标信息
export const getIconInfo = (iconName) => {
  return Object.values(ALL_ICONS).find(icon => icon.name === iconName);
};

// 图标分类
export const ICON_CATEGORIES = {
  EQUIPMENT: 'equipment',
  PERSON: 'person'
};

// 默认图标配置
export const DEFAULT_ICON_CONFIG = {
  size: '16px',
  color: 'currentColor',
  clickable: false
};

// 图标样式预设
export const ICON_STYLE_PRESETS = {
  // 主要样式
  PRIMARY: {
    color: '#4a90e2',
    size: '20px'
  },
  // 成功样式
  SUCCESS: {
    color: '#2ed573',
    size: '20px'
  },
  // 警告样式
  WARNING: {
    color: '#ffa502',
    size: '20px'
  },
  // 危险样式
  DANGER: {
    color: '#ff4757',
    size: '20px'
  },
  // 信息样式
  INFO: {
    color: '#3742fa',
    size: '20px'
  },
  // 大尺寸
  LARGE: {
    size: '32px'
  },
  // 小尺寸
  SMALL: {
    size: '14px'
  }
};

export default {
  EQUIPMENT_ICONS,
  PERSON_ICONS,
  ALL_ICONS,
  ICON_CATEGORIES,
  DEFAULT_ICON_CONFIG,
  ICON_STYLE_PRESETS,
  getIconsByCategory,
  searchIcons,
  getIconInfo
};

